﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommonTools;
using CommonTools.Basic;
using CommonTools.Controls;
using shop.Bll.BasicInfo;
using shop.Model;

namespace shop.BasicInfo
{
    public class JCustomerBllAction: BasicActionBase<JCustomerBll>
    {

		[BasicAction(nameof(JCustomer.SalesRep))]
		public void Txt_SalesRep_RequestValidate(FastTextBox arg1, FastValueArgs arg2)
		{
			if (arg2.ChangeMode == ChangeModeEnum.Clear)
			{
				//将单据内容关联属性清空 
				return;
			}

			var model = FastBox.GetValue<JSubMessage, shop.Bll.BasicInfo.JSubMessageBll>(arg1.Text, arg2.CallFilter, "5");

			if (model == null)
			{
				arg2.Cancel = true;     //没有查询到结果, 还原输入内容 (这里不用修改关联内容了)
			}
			else
			{
				arg1.Text = model.Name;
			}
		}
	}
}
